Repository navigation
Preserve missing accessor halves when subtracting - #3121
OskarEichler wants to merge 3 commits into
Conversation
|
The existing accessor test exposed the intended changed output but still asserted that the whole accessor disappeared. I updated it in 8e1d830 and expanded the case to cover reader-only, writer-only, and complete subtraction. The focused subtractor suite passes (23 tests), targeted RuboCop is clean, and |
|
I am against subtracting only a part of attr_accessor, as it may lead to unintended behavior. Please let me know the problem you are trying to solve. |
|
Thanks for clarifying the intended semantics. This came from a synthetic subtraction case, not an observed application failure: an attr_accessor on one side and only one matching reader/writer declaration on the other. I assumed subtraction should retain the unmatched half, but that is a behavioral policy choice rather than a demonstrated bug. I do not have a real-world case that justifies changing that policy, so I will not push further changes based on that assumption. |
|
The problem to be solved is unclear. Closing this. |
Summary: split an accessor when only its reader or writer already exists, so subtraction preserves the missing half and its metadata.
Verification: focused baseline/fixed reproduction, combined RBS 4.2.0 consumer models, and RuboCop (738 files, zero offenses). No tests are added in this PR.
Compatibility: no public API removal or dependency/version change.